<template>
  <div id="clockinrecord">
    <div id="record">
      <c-title :hide="false" :text="title"></c-title>
      <!-- 新页面 -->
      <div id="content">
        <div></div>
      </div>
      <!-- end -->
      <div class="record-content flex flex-a-c" :style="{'background-image':'url(' + imgHost + 'clock-in/record.png)'}" >
        <div class="record-bg"></div>
        <!-- <h3>我的战绩</h3> -->
        <div class="record-data">
          <div class="data_box">
            <span class="data">{{ payAmount }}</span
            >
            <span class="amount">累计投入({{$i18n.t('元')}})</span>
          </div>

          <div class="data_box">
            <span class="data">{{ rewardAmount }}</span
            >
            <span class="amount">累计赚取({{$i18n.t('元')}})</span>
          </div>

          <div class="data_box">
            <span class="data">{{ clockNum }}</span
            >
            <span class="amount">累计打卡(天)</span>
          </div>
        </div>
      </div>
      <div class="record-info" v-if="recordDetailShow">
        <h3>战绩明细</h3>
        <van-pull-refresh v-model="isLoading" @refresh="loadTop" success-text="刷新成功">
          <div class="record-list" >
            <div class="record-item flex-a-c flex-j-sb"  v-for="(item,i) in recordDetail" :key='i'>
              <p>{{ item.created_at }}</p>
              <div class="status">
                <p>{{ item.clock_in_status_name }}</p>
                <p class="amount">
                  {{
                    fun.isTextEmpty(item.has_one_reward)
                      ? ""
                      : item.has_one_reward.amount
                  }}
                </p>
              </div>
              
            </div>
          </div>
        </van-pull-refresh>
      </div>
    </div>
  </div>
</template>

<script>
import clockinrecord_controller from "./clockinrecord_controller";
export default clockinrecord_controller;
</script>
<style lang="scss" rel="stylesheet/scss" scoped>
#record {
  color: #fff;
  text-align: left;
  .record-content {
    height: 100px;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
    h3 {
      line-height: 2.5rem;
      padding: 0.625rem 0.75rem 0 0.75rem;
      font-size: 1.125rem;
    }
    .record-bg {
      position: absolute;
      top:0;
      left:0;
      width:100%;
      height: 100%;
      z-index: -1;
    }

    .record-data {
      width:100%;
      font-size: 0.9375rem;
      display: flex;

      .data_box {
        flex:1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
      }

      div {
        .data {
          font-size: 1.125rem;
          color: #333333;
          padding:0 0 0.5rem 0;
          font-weight: 800;
        }

        .amount {
          font-size: 0.75rem;
          color: #333333;
        }
      }
    }
  }
  .record-info {
    margin:0 0.75rem;
    background: #FFFFFF;
    border-radius: 0.625rem;
    padding:0.9375rem 0.875rem 0 0.875rem;
    position: relative;
    top:-0.625rem;
    h3 {
      font-weight: bold;
      font-size: 0.9375rem;
      color: #333333;
    }
    .record-list {
      .record-item {
        padding:1.125rem 0;
        border-bottom: 0.0625rem solid #F0F0F0;
        &:last-child{
          border-bottom: none;
        }
        p {
          font-size: 0.8125rem;
          color: #333333;
        }
        .amount {
          padding:0.25rem 0 0 0;
          text-align: right;
        }
      }
    }
  }
}
</style>
